<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use App\Http\Requests\Request;
class AddCartRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
//    public function authorize()
//    {
//        return false;
//    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'shop_id' => 'required',
            'num' => 'required|numeric|gt:0',
        ];
    }

    public function messages()
    {
        return [
            'shop_id.required' => retStrInfo(202),
            'num.required' => retStrInfo(202),
            'num.gt' => retStrInfo(204),
        ];
    }
}
